const fs = require('fs');

const path = require('path');

module.exports = function(name){
    let filename = path.resolve(__dirname,'../src/mock',name);

    if(fs.existsSync(filename)){
        return {code:1,data:JSON.parse(fs.readFileSync(filename,'utf8'))};
    }else{
        return {code:0,msg:'暂无数据'}
    }
}